package tool.zyk.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import tool.zyk.bo.AppointmentBO;
import tool.zyk.dto.UserInfo;
import tool.zyk.spring.annotation.RpcConsumer;

import java.util.Date;

/**
 * @author feite.zyk
 * @time 2024/2/2 14:36
 * @description
 */

@Slf4j
@Component
public class AppointmentServiceImpl implements AppointmentService {
    @RpcConsumer(serverName = "rpc-server")
    private UserService userService;

    @Override
    public AppointmentBO getAppointmentInfo(Long id) {
        UserInfo userInfo = userService.getUserInfo(id);
        AppointmentBO appointmentBO = new AppointmentBO();
        appointmentBO.setUserInfo(userInfo);
        appointmentBO.setDate(new Date());
        return appointmentBO;
    }
}
